﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AddSiteColumnToListInfo.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the NavigationSetting type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Wss.Entities
{
    using System;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [CollaborisClass(
        Title = "Add Site Column To List Info",
        ReleaseStatus = ReleaseStatus.Beta,
        DisableDocumentation = false,
        ContactAuthorEmail = "Support@Collaboris.co.uk",
        Summary = "Defines the parameters to add an existing site column to an existing SharePoint list."
    )]
    [Serializable]
    public class AddSiteColumnToListInfo : WSSEntityBase
    {
        #region Constants and Fields

        /// <summary>
        /// Site column name.
        /// </summary>
        private string fieldName;

        /// <summary>
        /// Site column name.
        /// </summary>
        private string listName;

        /// <summary>
        /// FieldCollection web url.
        /// </summary>
        private string fieldCollectionWebUrl;

        #endregion

        #region Properties

        [CollaborisProperty(
             Summary = "Specifies the name of the site field (column) to add to the list.",
             Title = "Field Name",
             Example = @"CustomerName",
             Required = true,
             InputHint = InputHint.SingleText
        )]
        public string FieldName
        {
            get
            {
                return this.fieldName;
            }

            set
            {
                this.fieldName = value;
            }
        }

        [CollaborisProperty(
                     Summary = "Specifies the name of the list to add the column to.",
                     Title = "List Name",
                     Example = @"Pages",
                     Required = true,
                     InputHint = InputHint.SingleText
        )]
        public string ListName
        {
            get
            {
                return this.listName;
            }

            set
            {
                this.listName = value;
            }
        }

        [CollaborisProperty(
                     Summary = "Specifies the full URL of the web site containing the" + 
                                " site fields collection. This field collection should contain the field to be added to the list.",
                     Title = "Field Collection Web Url",
                     Example = @"${CurrentWeb.Url}",
                     Remarks = "If this is not supplied then the current URL, of the context" + 
                                " web will be used to identify the field collection.",
                     Required = false,
                     InputHint = InputHint.Url
        )]
        public string FieldCollectionWebUrl
        {
            get
            {
                return fieldCollectionWebUrl;
            }
            set
            {
                fieldCollectionWebUrl = value;
            }
        }

        #endregion
    }
}